home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 2002 January / PC Answers January 2002.7z / PC Answers January 2002.bin / graphics / freepixl / _SETUP.1 / Context.pxl < prev    next >
Text File  |  2000-12-23  |  4KB  |  168 lines

  1. Initialize:
  2.     UseCoordinates(PIXEL)
  3.     Title$ = "Test Context Sensitive Help"
  4.     UseCaption(Title$)
  5.     WinLocate(Title$,100,100,600,250,Res)
  6.     WinShow(Title$,NOTOPMOST,Res)
  7.     DirGet(SourceDir$)
  8.     UseBackGround(TRANSPARENT,192,192,192)
  9.     DrawBackGround
  10.     Context$ = ""
  11.     InfoMenu(REMOVE)
  12.     WaitInput(100)
  13.     SetMenu("&File",IGNORE,
  14.         "E&xit!",Run_Leave,
  15.         ENDPOPUP,
  16.         "&HLP File",Get_Hlp_File,
  17.         ENDPOPUP,
  18.         "&Select Context",IGNORE,
  19.         "&CONTEXT ID",Get_Hlp_File_1,
  20.         "&TOPIC_name",Get_Hlp_File_2,
  21.         ENDPOPUP,
  22.         "&MAP file",View_MAP,
  23.         ENDPOPUP,
  24.         "&Help",IGNORE,
  25.         "&Concept",Concept,
  26.         SEPARATOR,
  27.         "&About",About,
  28.         ENDPOPUP)
  29.  
  30. Wait_for_Input:
  31.     WaitInput()
  32.  
  33. Run_Leave:
  34.     End
  35.  
  36. Get_Hlp_File:
  37.     DrawBackGround
  38.     Filter$ = "Help Files(*.hlp),*.hlp"
  39.     Caption$ = "Select the Help file to run"
  40.     InitDir$ = SourceDir$
  41.     InitFile$ = "*.hlp"
  42.     HLPfile$ = ""
  43.     FileGet(Filter$,InitFile$,InitDir$,Caption$,CHANGEDIR,HLPfile$)
  44.     If HLPfile$ = "" Then Goto Wait_for_Input
  45.     Select$ = "Selected File  " + HLPfile$
  46.     UseFont("Arial",9,21,NOBOLD,NOITALIC,NOUNDERLINE,0,0,0)
  47.     DrawText(11,11,Select$)
  48.     UseFont("Arial",9,21,NOBOLD,NOITALIC,NOUNDERLINE,255,255,0)
  49.     DrawText(10,10,Select$)
  50.     Goto Wait_for_Input
  51.  
  52.  
  53.  
  54. Get_Hlp_File_1:
  55.     If HLPfile$ <> "" Then Goto Get_Hlp_File_1a
  56.         MessageBox(OK,1,EXCLAMATION,"Please select a Helpfile.",
  57.         "No HLP file has been selected",Res)
  58.         Goto Wait_for_Input
  59.     {endif}
  60.  
  61. Get_Hlp_File_1a:
  62.     Label$ = "WinHelp CONTEXT"
  63.     Text$ = "Help file: " + HLPfile$
  64.     Text$ = Text$ + "
  65.  
  66. Enter the context ID integer. If you don't know
  67. what this is, see the help <project>.hh file."
  68.     TextBox(Text$,Label$,Context$,Btn)
  69.     If Btn = 2 Then Goto Wait_for_Input
  70.  
  71.     If Context$ <> "" Then Goto Get_Hlp_File_1b
  72.     MessageBox(OK,1,EXCLAMATION,"Please enter a Context ID.",
  73.     "No Context ID selected.",Res)
  74.     Goto Get_Hlp_File_1a
  75.     
  76. Get_Hlp_File_1b:
  77.     CommandLine$ = "winhlp32 -n " + Context$
  78.     CommandLine$ = CommandLine$ + " "
  79.     CommandLine$ = CommandLine$ + HLPfile$
  80.     Run(CommandLine$)
  81.     Goto Wait_for_Input
  82.  
  83. Get_Hlp_File_2:
  84.     If HLPfile$ <> "" Then Goto Get_Hlp_File_2a
  85.         MessageBox(OK,1,EXCLAMATION,"Please select a Helpfile.",
  86.         "No HLP file has been selected",Res)
  87.         Goto Wait_for_Input
  88.     {endif}
  89.  
  90. Get_Hlp_File_2a:
  91.     Label$ = "WinHelp CONTEXT"
  92.     Text$ = "Help file: " + HLPfile$
  93.     Text$ = Text$ + "
  94.  
  95. Enter the exact TOPIC_NAME, using '_' between words.
  96. If you don't know what this is, see the ROBOHELP 
  97. <project>.hh file."
  98.     TextBox(Text$,Label$,Context$,Btn)
  99.     If Btn = 2 Then Goto Wait_for_Input
  100.  
  101.     If Context$ <> "" Then Goto Get_Hlp_File_2b
  102.     MessageBox(OK,1,EXCLAMATION,"Please enter a TOPIC_NAME.",
  103.     "No TOPIC_NAME selected.",Res)
  104.     Goto Get_Hlp_File_2a
  105.     
  106. Get_Hlp_File_2b:
  107.     CommandLine$ = "winhlp32 -i " + Context$
  108.     CommandLine$ = CommandLine$ + " "
  109.     CommandLine$ = CommandLine$ + HLPfile$
  110.     Run(CommandLine$)
  111.     Goto Wait_for_Input
  112.  
  113.  
  114. View_MAP:
  115.     Filter$ = "MAP Files(*.hh),*.hh"
  116.     Caption$ = "Select the Help project map file"
  117.     InitDir$ = SourceDir$
  118.     InitFile$ = "*.hh"
  119.     HLPfile$ = ""
  120.     FileGet(Filter$,InitFile$,InitDir$,Caption$,CHANGEDIR,MAPfile$)
  121.     If MAPfile$ = "" Then Goto Wait_for_Input
  122.     CommandLine$ = "notepad " + MAPfile$
  123.     Run(CommandLine$)
  124.     Goto Wait_for_Input
  125.  
  126. Concept:
  127.     MessageBox(OK,1,INFORMATION,
  128. "This utility is used to test the links to context
  129. sensitive help topics in HLP files. You are asked
  130. for a HLP file, and then a context ID number or the
  131. actual topic. If a HLP file has not been defined, 
  132. you cannot enter an ID number. Once you have selected
  133. an HLP file, you can select any context ID number or
  134. topic.
  135.  
  136. You can also invoke NotePad to view ROBOHELP (tm)
  137. generated <project>.hh files.This is the list 
  138. of '#define <context_id> <integer>' entries 
  139. needed for the Windows application developer.
  140.  
  141. If an ID number is entered, WINHELP is invoked
  142. by the command line
  143.  
  144.     'winhlp32 -n <integer> <project>.hlp'
  145.  
  146. or if a topic_name is entered, using
  147.  
  148.     'winhlp32 -i <topic_name> <project>.hlp'
  149.  
  150. If WINHELP cannot locate the context ID or topic, 
  151. you will be prompted with a warning message that
  152. the 'Topic does not exist'.",
  153.     "Context Sensitive Help",Res)
  154.     Goto Wait_for_Input
  155.  
  156. About:
  157.     AboutUser("About Context","Context Sensitive Help Test Program.", 
  158. "Copyright ⌐ (1995-98) VYSOR Integration Inc.
  159. Gatineau, Quebec, CANADA. All Rights Reserved.")
  160.     Goto Wait_for_Input
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.         
  168.